The genitofemoral nerve is formed in the substance of the psoas major muscle from the ventral rami of the L1 and L2.  The nerve descends obliquely through the muscle, to emerge from its anterior surface, where it penetrates the psoas fascia and descends posterior to the ureter.  It divides, above the inguinal ligament, lateral to the external iliac artery, into genital and femoral branches.  

The genital branch descends anterior to the external iliac artery, which it gives branches to, to enter the inguinal canal via the deep inguinal ring.  In the male it emerges with the spermatic cord, to give off branches to the cremaster muscle, testicular autonomic plexus and the skin of the scrotum adjacent to the thigh.  In the female, it accompanies the round ligament of the uterus to terminate in the skin of the mons pubis and labium majus.  

The femoral branch descends on the lateral aspect of the external iliac artery to enter the thigh behind the inguinal ligament.  It enters the femoral sheath lateral to the femoral artery, which it supplies.  It pierces the anterior femoral sheath and the fascia lata to terminate in the skin over the superior part of the femoral triangle, lateral to the territory supplied by the ilioinguinal nerve.

Supply
The genital branch supplies the external iliac artery; in the male the cremaster muscle, testicular autonomic plexus and the skin of the scrotum adjacent to the thigh and in the female the skin of the mons pubis and labium majus.  The femoral branch supplies the femoral artery and skin over the superior part of the femoral triangle.